class HeatingState implements State {
    @Override
    public void onTemperatureBelow20AndHasWater(WaterTank tank) {}
    @Override
    public void onTemperatureReached100(WaterTank tank) {
        System.out.println("温度达到100°C，关闭加热。");
        tank.setPowerOn(false);
        tank.setCurrentState(new NotHeatingState());
    }
    @Override
    public void onNoWater(WaterTank tank) {
        System.out.println("水箱无水，立即断电。");
        tank.setPowerOn(false);
        tank.setCurrentState(new NotHeatingState());
    }
    @Override
    public void onBurnedOut(WaterTank tank) {
        tank.setIsBurnedOut(true);
        System.out.println("水箱烧坏！停止加热并进入维修。");
        tank.setPowerOn(false);
        tank.setCurrentState(new NotHeatingState());
    }
    @Override
    public void onMorning7(WaterTank tank) {}
    @Override
    public void onNight11(WaterTank tank) {
        System.out.println("晚上11点，自动断电。");
        tank.setPowerOn(false);
        tank.setCurrentState(new UnstartedState());
    }
}